package com.itheima.sh.dao;

import com.itheima.sh.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {
    //登录时的查询
    @Select("select * from user where username=#{username} and password=#{password}")
    User login(User user);

    //注册时的查询
    @Select("select * from user where username=#{username}")
    User queryUserByUserName(@Param("username") String username);
    //注册时的添加
    @Insert("insert into user values(null,#{username},#{password})")
    void register(User user);
}
